import React, { PureComponent } from 'react';
import { connect } from 'dva';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { Card } from 'antd';
import moment from 'moment';
import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;
@connect(({ integratedqueryns, loading }) => ({
  loading: loading.models.integratedqueryns,
  empBaseInfo: integratedqueryns.empBaseInfo, // 员工基本信息
}))
@Form.create()
class EmpInfor extends PureComponent {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() {}

  render() {
    const { empBaseInfo } = this.props;
    return (
      <div>
        <Card
          style={{ marginBottom: 12 }}
          title={<span style={{ fontWeight: 'bolder' }}>员工基本信息</span>}
          bordered={false}
          id="basicinfor"
        >
          <DescriptionList>
            <Description term="姓名">{(empBaseInfo && empBaseInfo.empName) || '--'}</Description>
            <Description term="证件类型">
              {(empBaseInfo && empBaseInfo.idTypeName) || '--'}
            </Description>
            <Description term="证件号">{(empBaseInfo && empBaseInfo.idCode) || '--'}</Description>
            <Description term="性别">{(empBaseInfo && empBaseInfo.genderName) || '--'}</Description>
            <Description term="国籍">{(empBaseInfo && empBaseInfo.nationName) || '--'}</Description>
            <Description term="出生日期">
              {empBaseInfo && empBaseInfo.birthDate
                ? moment(empBaseInfo.birthDate).format('YYYY-MM-DD')
                : '--'}
            </Description>
            <Description term="电话">{(empBaseInfo && empBaseInfo.mobile) || '--'}</Description>
            <Description term="员工邮箱">{(empBaseInfo && empBaseInfo.email) || '--'}</Description>
            <Description term="在职状态">
              {(empBaseInfo && empBaseInfo.statusName) || '--'}
            </Description>
          </DescriptionList>
        </Card>
      </div>
    );
  }
}

export default EmpInfor;
